<template>
	<view>
		<view class="warp">
			<view class="swiper-warp">

				<u--image :showLoading="true"
					src="https://images.unsplash.com/photo-1631049552057-403cdb8f0658?ixlib=rb-1.2.1&auto=format&fit=crop&w=800&q=80"
					width="100%" height="250px"></u--image>
			</view>
			<view class="product-body">
				<view class="card">
					<view class="Price"> 万腾-观澜城 </view>
					<view class="tag-List">
						<view class="tag">品牌房企</view>
						<view class="tag">学区房</view>
						<view class="tag">即将交房</view>
					</view>
				</view>
				<view class="card">
					<view class="item">
						<view class="lable"> 房产均价 </view>
						<view class="value" style="color: #ff0000; font-size: 36rpx; font-weight: bold"> 5200-6300元/㎡
						</view>
					</view>
					<view class="item">
						<view class="lable"> 产品类型 </view>
						<view class="value"> 住宅 </view>
					</view>
					<view class="item">
						<view class="lable"> 建筑面积 </view>
						<view class="value"> 108-138㎡ </view>
						<view class="lable"> 开盘时间 </view>
						<view class="value"> 2024-08-08 </view>
					</view>
					<view class="item">
						<view class="lable"> 产权年限 </view>
						<view class="value"> 70年 </view>
					</view>
					<view class="item">
						<view class="lable"> 预售证号 </view>
						<view class="value"> xxxxxxx </view>
					</view>
					<view class="item">
						<view class="lable"> 开发公司 </view>
						<view class="value"> xxxxxxx </view>
					</view>
					<view class="item">
						<view class="lable"> 楼盘地址 </view>
						<view class="value"> xxxxxxx </view>
					</view>
				</view>
				<view class="card">
					<view> 户型图展示 </view>
				</view>
				<view class="card">
					<view> 楼盘介绍 </view>

					xxxxx
				</view>
			</view>
		</view>
		<view class="operation">
			<view>
				<image src="/static/share.png" style="width: 50rpx; height: 50rpx"></image>
				<view style="font-size: 26rpx"> 分享 </view>
			</view>
			<view style="width: 70%">
				<view class="reserve"> 立即预定 </view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				property: {},
			};
		},
		onLoad(options) {
			const propertyId = options.id; // 获取传递的 id
			this.fetchPropertyDetail(propertyId);
		},
		methods: {
			fetchPropertyDetail(id) {
				// 这里可以根据 id 从 API 或本地数据中获取房产详情
				// 示例数据
				this.property = {
					id: 1,
					imageSrc: "https://images.unsplash.com/photo-1631049552057-403cdb8f0658?ixlib=rb-1.2.1&auto=format&fit=crop&w=800&q=80",
					title: "出租县城两室一厅120平米，租金10000元/月",
					price: "10000元/月",
					type: "2室1厅1卫",
					area: "120平米",
					date: "2025-02-22",
					description: "房源描述信息...",
					features: ["洗衣机", "空调", "电视机", "床"],
					publisher: "王老板",
					publishDate: "2025-02-22",
					address: "县城-附近",
					latitude: 34.123456, // 示例经度
					longitude: 108.123456, // 示例纬度
				};
			},
			contact() {
				// 处理联系发布人的逻辑
				console.log("联系发布人");
			},
		},
	};
</script>

<style lang="scss">
	.warp {
		min-height: 100vh;
		background-color: #ebe7e7;
		padding-bottom: 180rpx;

		.swiper-warp {}

		.product-body {
			padding: 15rpx 15rpx;

			.card {
				background-color: #fff;
				border-radius: 10rpx;
				padding: 30rpx;
				margin-bottom: 15rpx;
			}

			.Price {
				color: #333;
				font-size: 38rpx;
				font-weight: bold;
				margin-bottom: 15rpx;
			}

			.tag-List {
				display: flex;

				.tag {
					font-size: 24rpx;
					color: #ff9933;
					background-color: #ff993330;
					padding: 10rpx 15rpx;
					border-radius: 10rpx;
					margin-right: 15rpx;
				}
			}

			.item {
				margin-bottom: 25rpx;
				display: flex;
				align-items: center;

				.lable {
					font-size: 30rpx;
					color: #888888;
					margin-right: 30rpx;
				}

				.value {
					font-size: 30rpx;
					color: #333;
					margin-right: 30rpx;
				}
			}
		}
	}

	.operation {
		position: fixed;
		left: 0;
		bottom: 0;
		padding: 30rpx 50rpx 50rpx 0rpx;
		background-color: #fff;
		width: 100%;

		display: flex;

		justify-content: space-around;
		align-items: center;

		.reserve {
			flex: none;
			/* 确保子元素宽度不会变 */
			color: #fff;
			font-size: 36rpx;
			font-weight: bold;
			border-radius: 50rpx;
			width: 100%;
			text-align: center;
			background-color: #ff0000;
			padding-top: 20rpx;
			padding-bottom: 20rpx;
		}
	}
</style>